/*
 * @Descripttion: 
 * @version: 
 * @Author: ChenXiang
 * @Date: 2021-04-28 23:33:48
 * @LastEditors: ChenXiang
 * @LastEditTime: 2021-04-29 10:57:39
 */
const exec = require('child_process').execSync

module.exports = () => {
  let name
  let email

  try {
    name = exec('git config --get user.name')
    email = exec('git config --get user.email')
  } catch (e) { }

  name = name && JSON.stringify(name.toString().trim()).slice(1, -1)
  email = email && (email.toString().trim())
  // email = email && (' <' + email.toString().trim() + '>')
  return (name || '') + ' ' + (email || '')
  // return { author: name, email }
}
